<?php

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ApprovalList extends Model
{
    use SoftDeletes;

    protected $table = 'approval_list';

    protected $fillable = [
        'project_id',
        'apply_type',
        'user_id',
        'content',
        'apply_status',
        'apply_reason',
        'step',
        'grid_id',
        'set_id',
    ];

    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }

    public function approval_template()
    {
        return $this->hasOne(ApprovalTemplate::class, 'id', 'apply_type');
    }

    public function grid()
    {
        return $this->hasOne(Grid::class, 'id', 'grid_id');
    }
}
